package com.xlhl.init.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.xlhl.init.model.entity.Permission;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @author xlhl
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PermissionVO implements Serializable {
    @Serial
    private static final long serialVersionUID = -6142743339984975069L;
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 权限编码
     */
    private String code;

    /**
     * 权限位数(从0开始)
     */
    private Long bitPosition;

    /**
     * 父级ID
     */
    private Long fatherId;

    /**
     * 权限描述
     */
    private String description;

    /**
     * 子节点
     */
    private List<PermissionVO> children;

    public PermissionVO(Permission permission) {
        BeanUtil.copyProperties(permission, this);
    }
}
